<template>

</template>

<script>
    export default {
        name: "bootpage",
        mounted() {
            this.loading()
        },
        methods: {
            loading() {
                const loading = this.$loading({
                    lock: true,
                    text: 'Loading',
                    spinner: 'el-icon-loading',
                    background: 'rgba(0, 0, 0, 0.7)'
                });
                setTimeout(() => {
                    axios.get('/api/checkLogin')
                        .then((res) => {
                            loading.close();
                            if (res.data.code===1){
                                this.$router.replace("/plugin")
                            }
                        })
                        .catch((error) => {
                            loading.close();
                            this.$Toast.errorToast('请求服务器失败!')
                        })
                }, 500);
            }
        }
    }
</script>

<style scoped>

</style>